I have HTML form (buttons, inputs, etc). Each component as its own event that trigger specific script. I want the browser to remember which action happened when the user press the "back" button. (Example: If the user presses the 'blue button', then he can return to the same place when he clicks "back" in the browser).
I thought of doing this by using local storage in every event that triggered. Then at the beginning of the code to check which local storage is exist and trigger the event again.
But it seems ineffective to me. Anyone have a better idea?
Thanks.